package org.robustcoupe.task.example.resources;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.robustcoupe.task.AbstractFluentTask;
import org.robustcoupe.task.Task;
import org.robustcoupe.task.TaskResultType;

public class LoggingCurrentTimeTask extends AbstractFluentTask {
  private static final Log LOG = LogFactory.getLog(LoggingCurrentTimeTask.class);
  
  private String prefix = "";
  
  public Task prefix(String prefix) {
    this.prefix = prefix + " - ";
    return this;
  }
  
  public TaskResultType execute() {
    LOG.info(prefix + System.currentTimeMillis());
    return TaskResultType.SUCCESS;
  }
}
